<template>
  <div data-v-86feb5c8="" class="promote-product">
    <div data-v-86feb5c8="" class="product-list">
      <div
        data-v-4fc4293a=""
        data-v-86feb5c8=""
        class="product-list_item"
        v-for="(item, index) in goodslist"
        :key="index"
      >
        <div data-v-4fc4293a="" class="product-img">
          <img
            data-v-4fc4293a=""
            src=""
            alt=""
            class="cross-borde-icon"
          />
          <!---->
          <img
            data-v-4fc4293a=""
            alt="商品图片"
            :src="item.imageUrl"
            lazy="loaded"
          />
          <div data-v-4fc4293a="" class="cross-borde-country">
            <img data-v-4fc4293a="" :src="item.labels.logo" alt="" />
            <span data-v-4fc4293a="" class="country">{{
              item.labels.country
            }}</span>
          </div>
        </div>
        <div data-v-4fc4293a="" class="product-info">
          <div
            data-v-4fc4293a=""
            class="product-name txt-cut color-333 font-px26"
          >
            <span data-v-4fc4293a="">{{ item.productName }}</span>
          </div>
          <!---->
          <div data-v-4fc4293a="" class="product-tag">
            <div
              data-v-4fc4293a=""
              class="yskMake"
              v-if="item.useHealthyCard == 1"
            >
              药神卡
            </div>
          </div>
          <div data-v-4fc4293a="" class="product-price">
            <div data-v-4fc4293a="" class="product-price-left">
              <div
                data-v-d4462b7e=""
                data-v-4fc4293a=""
                class="money_show"
                fontcolor="#FF7900"
              >
                <span data-v-d4462b7e="" class="now_money"
                  ><span data-v-d4462b7e=""
                    ><span data-v-d4462b7e="" class="font-px28">¥</span
                    ><span data-v-d4462b7e="" class="font-px38"
                      >{{formatprice(item.price,0)}}<span data-v-d4462b7e="" class="font-px26"
                        >.{{formatprice(item.price,1)}}</span
                      ></span
                    ></span
                  ></span
                >
              </div>
            </div>
            <div data-v-cdd5d3c4="" data-v-4fc4293a="" class="cart-icon">
              <img
                data-v-cdd5d3c4=""
                src=""
                alt="加购物车"
              />
            </div>
          </div>
          <div data-v-4fc4293a="" class="go-store">
            <p data-v-4fc4293a="" class="store-name">药兜国际旗舰店</p>
            <span data-v-4fc4293a="" class="go">进店 &gt;</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { getydgjlist } from "../api/zl-goods";
export default {
  data() {
    return {
      goodslist: [],
    };
  },
  created() {
    getydgjlist().then((res) => {
      this.goodslist = [...res.data.data.products];
    });
  },
  methods: {
    formatprice(pri, i) {
      if (pri) {
        pri = pri + "";
        let arr = pri.split(".");
        if (arr.length == 1) {
          arr.push("00");
        } else {
          arr[1] < 10 ? (arr[1] = arr[1] + "0") : "";
        }
        return arr[i];
      }
    },
  },
};
</script>

<style src="../assets/css/ydapp.css" scoped>
</style>
<style src="../assets/css/ydgj.css" scoped>
</style>